using System.Collections;
using System.Collections.Generic;
using System.Net.NetworkInformation;
#if UNITY_EDITOR // => Ignore from here to next endif if not in editor
using UnityEditor;
using UnityEngine;
namespace JSG.BubbleShoot
{
    [CustomEditor(typeof(EditorBallBase))]
    [CanEditMultipleObjects]

    public class BallEditor : Editor
    {
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            Object[] balls = targets;

            if (GUILayout.Button("Type : Color"))
            {
                for (int j = 0; j < balls.Length; j++)

                {
                    ((EditorBallBase)balls[j]).SetType(0);
                    EditorUtility.SetDirty(balls[j]);
                }

            }

            if (GUILayout.Button("Type : Bomb"))
            {
                for (int j = 0; j < balls.Length; j++)

                {
                    ((EditorBallBase)balls[j]).SetType(1);
                    EditorUtility.SetDirty(balls[j]);
                }

            }

            if (GUILayout.Button("Type : Rock"))
            {
                for (int j = 0; j < balls.Length; j++)

                {
                    ((EditorBallBase)balls[j]).SetType(2);
                    EditorUtility.SetDirty(balls[j]);
                }

            }

            GUILayout.Space(20);

            for (int i = 0; i < 6; i++)
            {
                if (GUILayout.Button("Set Color " + (i + 1).ToString()))
                {
                    for (int j = 0; j < balls.Length; j++)

                    {
                        ((EditorBallBase)balls[j]).SetColor(i);
                        EditorUtility.SetDirty(balls[j]);
                    }

                }
            }
        }
    }
}
#endif